﻿using System;
using Login.DBHelper;
using Npgsql;

namespace cashbook_psql_cs.DAL
{
    internal class LoginUserDAL
    {
        internal int UserLogin(LoginUser user)
        {
            SQLHelper sqlHelper = new SQLHelper();
            int i = Convert.ToInt32(sqlHelper.ExecuteScalar("select count(*) from login_user where user_id=@UserName and password=@PassWord",
                 new NpgsqlParameter("@UserName", user.UserId),
                  new NpgsqlParameter("@PassWord", user.Password)));
            return i;
        }
    }
}
